/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TimeRecording.widgets;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 *
 * @author david
 */
public class DaisyChainCalendar {

    public final static Date START_OF_TIME =
            new GregorianCalendar(2000, 0, 1).getTime();
    
    public final static Date END_OF_TIME =
            new GregorianCalendar(3000, 0, 1).getTime();

    public static Date startOfYear() {
        GregorianCalendar now = new GregorianCalendar();
        now.set(Calendar.MONTH, 0);
        now.set(Calendar.DAY_OF_MONTH, 1);
        now.set(Calendar.HOUR_OF_DAY, 0);
        now.set(Calendar.MINUTE, 0);
        now.set(Calendar.SECOND, 0);
        now.set(Calendar.MILLISECOND, 0);
        return now.getTime();
    }

    public static Date endOfYear() {
        GregorianCalendar now = new GregorianCalendar();
        now.set(Calendar.MONTH, 11);
        now.set(Calendar.DAY_OF_MONTH, 31);
        now.set(Calendar.HOUR_OF_DAY, 23);
        now.set(Calendar.MINUTE, 59);
        now.set(Calendar.SECOND, 59);
        now.set(Calendar.MILLISECOND, 99);
        return now.getTime();
    }

    public static Date startOfToday() {
        GregorianCalendar now = new GregorianCalendar();
        now.set(Calendar.HOUR_OF_DAY, 0);
        now.set(Calendar.MINUTE, 0);
        now.set(Calendar.SECOND, 0);
        now.set(Calendar.MILLISECOND, 0);
        return now.getTime();
    }

    public static Date endOfToday() {
        GregorianCalendar now = new GregorianCalendar();
        now.set(Calendar.HOUR_OF_DAY, 23);
        now.set(Calendar.MINUTE, 59);
        now.set(Calendar.SECOND, 59);
        now.set(Calendar.MILLISECOND, 99);
        return now.getTime();
    }
}
